﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Collections;
using System.Windows.Forms;

namespace sales.forms
{
    public partial class posDebtOption : common.forms.baseDialogForm
    {
        public posDebtOption()
        {
            try
            {
                InitializeComponent();
                monthCb.LoadData();
                yearCb.LoadData();
                yearCb.myYear = DateTime.Today.Year;
                monthCb.myMonth = DateTime.Today.Month;
                if (monthCb.myMonth == 1)
                {
                    monthCb.myMonth = 1;
                    yearCb.myYear -= 1;
                }
                else monthCb.myMonth -= 1;
            }
            catch(Exception er)
            {
                this.ShowError(er);
            }
        }
        public DateTime myFromDate
        {
            get
            {
                return common.dateTimeLibs.MakeDate(1, this.monthCb.myMonth, this.yearCb.myYear);
            }
        }
        public DateTime myToDate
        {
            get
            {
                return this.myFromDate.AddMonths(1).AddDays(-1);
            }
        }

    }
}
